//
//  BaseApi.h
//  RtMart
//
//  Created by 福利购Mac on 16/12/19.
//  Copyright © 2016年 JASON. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RTNetWroking.h"
#import "APIConsts.h"
//#import "SystemLockController.h"

typedef void (^ BaseResultBlock)(NSDictionary* data, NSError *error);
@interface BaseApi : NSObject
- (id)create:(id)entity withBlock:(BaseResultBlock)block;
- (id)update:(id)entity withBlock:(BaseResultBlock)block;
- (id)upvote:(id)entity withBlock:(BaseResultBlock)block;
-(void)showFailMessage:(NSError *)error;

/**
 post
 
 @param baseUrl 请求地址
 @param parameters 参数集合
 @param cache 缓存策略(cache 0:默认缓存,1:不考虑缓存)
 @param block 结果回调
 */
- (void)requestDataWithUrl:(NSString *)baseUrl parameters:(NSDictionary *)parameters cacheTypeValue:(NetWorkingCacheType)cache resultBlock:(BaseResultBlock)block;
//上传单张图片
- (void)upLoadSingleFileWithUrl:(NSString *)baseUrl parameters:(NSDictionary *)parameters image:(UIImage *)image resultBlock:(BaseResultBlock)block;
//上传多张图片
- (void)upLoadMultiFileWithUrl:(NSString *)baseUrl parameters:( NSDictionary *)parameters imageArray:(NSArray<UIImage *> *)imageArray resultBlock:(BaseResultBlock)block;

/**
 提交数据菊花
 */
- (void)needDisplaySVProgressHUD;

- (void)requestJsonDataWithUrl:(NSString *)baseUrl parameters:(NSDictionary *)parameters cacheTypeValue:(NetWorkingCacheType)cache resultBlock:(BaseResultBlock)block;

-(void)postStrRequestWithURL:(NSString *)url  parameters:(NSDictionary *)params acheTypeValue:(NetWorkingCacheType)cache resultBlock:(BaseResultBlock)block;

- (void)requestGetDataWithUrl:(NSString *)baseUrl parameters:(NSDictionary *)parameters cacheTypeValue:(NetWorkingCacheType)cache resultBlock:(BaseResultBlock)block;
//@property (nonatomic, strong) SystemLockController  *systemLockController;
@end
